<div style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px;">
  <div></div> <!-- Пустой блок, чтобы центр работал правильно -->
  <div style="text-align: center; font-weight: bold; font-size: 40px;">{{ factory_name }}</div>
  <div style="text-align: right; font-size: 18px;">{{ detail_name }}</div>
</div>

<table style="border-collapse:collapse;" width="100%" border="1px">
    <tr>
      <th scope="col">Контролёр</th>
      <th scope="col">Фильтр</th>
      <th scope="col">Длина</th>
      <th scope="col">Скорость</th>
      <th scope="col">Дата измерения</th>
    </tr>
    {% for traces in traces_data %}
      {% for data in traces.trace_data %}
      <tr>
        <th scope="col">{{ data.controler_name }}</th>
        <th scope="col">{{ data.filter }}</th>
        <th scope="col">{{ data.trace_length }}</th>
        <th scope="col">{{ data.speed }}</th>
        <th scope="col">{{ data.creation_date }}</th>
      </tr>
      {% endfor %}
    {% endfor %}
</table>
![](data:image/png;base64,{{first(imgs)}}){ width=100% }

<table style="border-collapse:collapse;" width="100%" border="1px">
  <tr>
    <th scope="col">Параметр</th>
    <th scope="col">Значение</th>
  </tr>
  {% for param_set in params %}
    {% for p in param_set.params %}
  <tr>
    <th scope="col">{{ p.name }}</th>
    <th scope="col">{{ p.value }}</th>
  </tr>
    {% endfor %}
  {% endfor %}
</table>
